UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wCJYyBaG9oyFWBdo6avCb7DvkEeWuViW5Eu2jURy14k='
WHERE
key_id = '56f38f75efc2909a37904cd8f825a644982c3840c9bd6e64c2e64e1eba0f07ac'
AND (
token = 'wCJYyBaG9oyFWBdo6avCb7DvkEeWuViW5Eu2jURy14k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)