UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K5NeMpCWkfjVqJH+ygxXCJkrVi/zjuLQNyVBiXsp3zE=' 
WHERE 
  key_id = '182035cf34545c7e977c6c9aff935d00e927d4c9423defb9ef7a2f3406577e7a' 
  AND (
    token = 'K5NeMpCWkfjVqJH+ygxXCJkrVi/zjuLQNyVBiXsp3zE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043