UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fh9g+p2a+iN2W8BI/0bYOxHa0C4hqRqU3qi4+JByuuc=' 
WHERE 
  key_id = 'e665f15c20df9e7e7153d97b2ae4988e6090ea261b388427429c11ebf90e9dac' 
  AND (
    token = 'fh9g+p2a+iN2W8BI/0bYOxHa0C4hqRqU3qi4+JByuuc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016