UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ax5AK7EBbzYlr6LU2qoN3q4GbbFk4nW8ncU8vPd81Ko='
WHERE
key_id = '1a612f939ce8b43be04befaee98fec64e1ad028d1832c18aa0ee6e391ca4c0de'
AND (
token = 'ax5AK7EBbzYlr6LU2qoN3q4GbbFk4nW8ncU8vPd81Ko='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)