UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gm6jybB9yK3nrkpvugtFPlqDMEFet4NeDq7t/AqWmMY=' 
WHERE 
  key_id = '363cb060715db606e88c29fe7763ffb55b986ee2a5651f6ccc406449c7d399fe' 
  AND (
    token = 'gm6jybB9yK3nrkpvugtFPlqDMEFet4NeDq7t/AqWmMY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031