UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'le4vChyKNEt9j/VGYg+AsD4hR3ECIeIZ3+dx+mMotLM='
WHERE
key_id = '04ec113e0c1ef762e0c0a4840cbe9df9cbc107b356898e6abfb69962c22ddc85'
AND (
token = 'le4vChyKNEt9j/VGYg+AsD4hR3ECIeIZ3+dx+mMotLM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)