UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's4WCTioa2AUTCBm0MkfNI+l2CQBOkIUTn3OkFFGydj8=' 
WHERE 
  key_id = '383dc669cce8580d4ffb6d71cf2a8434e80f32c9e807b98c135ce685b077d871' 
  AND (
    token = 's4WCTioa2AUTCBm0MkfNI+l2CQBOkIUTn3OkFFGydj8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031