UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OCiEG68IRDDR/XftBb6nrYUva85xSQWW/qg0oJgSeF4=' 
WHERE 
  key_id = '95dc83eef9def4ff2650acd33f01fa976356bfadbef94b7eec9058afab9c733a' 
  AND (
    token = 'OCiEG68IRDDR/XftBb6nrYUva85xSQWW/qg0oJgSeF4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041