UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ANq/CP/Gcxjr73jcDQeCoumLeojWH8GoIrbj4fm4UGk=' 
WHERE 
  key_id = '49e6dd84c2fb336e7531e1689ebc3eac860270475f4b861290c4ea94099b4b6d' 
  AND (
    token = 'ANq/CP/Gcxjr73jcDQeCoumLeojWH8GoIrbj4fm4UGk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053