UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5VYeIfNrCEhuEOd9+PUJsMJ+yBmmEJ5U0Y4RCNp9jtU='
WHERE
key_id = '66e13ccf9164107525e70c3994f5644373022b58730303da41a456b69ad3cc1b'
AND (
token = '5VYeIfNrCEhuEOd9+PUJsMJ+yBmmEJ5U0Y4RCNp9jtU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)