UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wB5ZLYwxyXpMdIlWsWJ4lTuymGRoaZQkbLtwhGGaXgQ=' 
WHERE 
  key_id = '07d423a1abd8ddb96d5f5f1ea1367c94c48d64faa05d7dc451f0660e67acd4b3' 
  AND (
    token = 'wB5ZLYwxyXpMdIlWsWJ4lTuymGRoaZQkbLtwhGGaXgQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027