UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YWsPJ6zC0/c8H8eVnfskD/kCqQnuDSxiVtvF2Vy84Ts='
WHERE
key_id = 'fd8e0e905accff939115b9327d4bc6a18aaf75c9cfb69960453083a2dabca140'
AND (
token = 'YWsPJ6zC0/c8H8eVnfskD/kCqQnuDSxiVtvF2Vy84Ts='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)