UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's2IH0x29GJs7/CetpUgqz2FoS0YUibdA3qssV8qyfNM='
WHERE
key_id = 'c16d6a59ea190f26ca4da5fce393a47297503cfba7c71ff5feee84bdffda14f8'
AND (
token = 's2IH0x29GJs7/CetpUgqz2FoS0YUibdA3qssV8qyfNM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)