UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yyrr/z62S0HvH0flLgfoClRS+eUZff8R9vp+PTNDYwg='
WHERE
key_id = '39f986813915659243df0cbbbadb4f9fa3436347ce1dc1f5298d4b1773d30024'
AND (
token = 'yyrr/z62S0HvH0flLgfoClRS+eUZff8R9vp+PTNDYwg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)