UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '06yDkvUuzOSp5JJ03JkV4O1D7sFRXHypUn6wFAheOO4=' 
WHERE 
  key_id = '4475e4057748a763841b2287d33ed6f98a529e0cf4abac907ef8269ee368e751' 
  AND (
    token = '06yDkvUuzOSp5JJ03JkV4O1D7sFRXHypUn6wFAheOO4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017