UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YKOKmnLJ7kNLJ28P8EAViSnwi5yDW5pMZlgTgdI8Qqc='
WHERE
key_id = '0d4a6c58bc0c0c7ba4f8faf77fe7e615e5f6c26f3e0acc392d8947fbe29150c5'
AND (
token = 'YKOKmnLJ7kNLJ28P8EAViSnwi5yDW5pMZlgTgdI8Qqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)