UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mLSiub7RnhJkcu1P1BUlOJRYzdS7nSGeIxSHdLDd9kI='
WHERE
key_id = '5b0b5b5aaaffa0fc65b910ea63830aa871488e7fd352ebc06304ea6b744fbb2e'
AND (
token = 'mLSiub7RnhJkcu1P1BUlOJRYzdS7nSGeIxSHdLDd9kI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)