UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ccQNcjV5JW+tCiYYd33VTw6FaC6bSampkMACYvpdaF0='
WHERE
key_id = 'ed349e071bbfebaadc51eb323920a2d3039484090b083b17eb2958ace152b857'
AND (
token = 'ccQNcjV5JW+tCiYYd33VTw6FaC6bSampkMACYvpdaF0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)