UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HbTwOG3Seb+TeBFWaLCyDekJ9usnn3uvtNI7B3chZFU='
WHERE
key_id = '104e1678b3745f63094d9e64c84768c569ef3d253c859a5fafdb1da4473888d1'
AND (
token = 'HbTwOG3Seb+TeBFWaLCyDekJ9usnn3uvtNI7B3chZFU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)