UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5ByURRqVLHNqP+L+fnv8bPD/CHEK7tQG4XOFEA2G95s=' 
WHERE 
  key_id = '97e8d969e258a7fd48ce3780e0ad7917b29e3d3cac969d5d14992ebd1a1c9543' 
  AND (
    token = '5ByURRqVLHNqP+L+fnv8bPD/CHEK7tQG4XOFEA2G95s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024