UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4eUWmuFeujCm3BKBGfrljZYmoXHBdEoSfnfGYNktPes='
WHERE
key_id = 'c5156a27cedb416eb770304ad82f6f4b7906c4f1de16ce7561dbe5f3a70af6a9'
AND (
token = '4eUWmuFeujCm3BKBGfrljZYmoXHBdEoSfnfGYNktPes='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)