UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hbw2fR0EOv1NRwylBexkPTEYeL7sqQFR4MRSfdZtKXk=' 
WHERE 
  key_id = '7b63c51def1e02ad743f257228064b72a8bc56a08cd023dbc91a70add6155ccf' 
  AND (
    token = 'Hbw2fR0EOv1NRwylBexkPTEYeL7sqQFR4MRSfdZtKXk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025