UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2CvbESiGZvXtW8ro1H/KGJSBjEgxZl9SNeOdOyhgXZE=' 
WHERE 
  key_id = 'cb9b16595c3d2fdcabdbe490d87d68947794d067faa765d4b508bacfcaa17f76' 
  AND (
    token = '2CvbESiGZvXtW8ro1H/KGJSBjEgxZl9SNeOdOyhgXZE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045