UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O3TYYh7pKK6pEjJe9LjzrWDQBC6XtnZ5ja9HuR25V04=' 
WHERE 
  key_id = '985abc86353aee4b5d0bcb1ab53f6e4cdd678fa05d92c6a020c127ae29b323c9' 
  AND (
    token = 'O3TYYh7pKK6pEjJe9LjzrWDQBC6XtnZ5ja9HuR25V04=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038