UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7iKazMTutfZ9J0kbIyx/8KkTeQIN6p74W7aA9wObqDk=' 
WHERE 
  key_id = '03fe6e1f3f323f510d5eb045164d3e4d200aec6a9224436b9edf2cccf476615f' 
  AND (
    token = '7iKazMTutfZ9J0kbIyx/8KkTeQIN6p74W7aA9wObqDk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026