UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2TgIz+4ZTo41fVgX798tv5Bvfh1QjFJbNxK5vvj6Mcg='
WHERE
key_id = 'ea61e0764d5fdd642f36d4af1b5c2e8b5adb72a69e8b29e49d150dce7346ba43'
AND (
token = '2TgIz+4ZTo41fVgX798tv5Bvfh1QjFJbNxK5vvj6Mcg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)