UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jol7uTyD0BsQ75ZlZWq1hSigqk/Erol6SXT9F0gmylo='
WHERE
key_id = 'ce460214711a84ddf46d2ba25d5c67aca0c0f33c4763feced619072247fb941c'
AND (
token = 'Jol7uTyD0BsQ75ZlZWq1hSigqk/Erol6SXT9F0gmylo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)